<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>addToken</title>
</head>
<body>
  <input id="token" type="text" placeholder="token">
  <input id="openId" type="text" placeholder="openId">
  <button id="btn">addToken</button>
  <script>
    var btn = document.getElementById('btn');
    btn.addEventListener('click', function () {
      var input = document.getElementById('token');
      var value = input.value;
      if (!value) {
        return;
      }

      var input = document.getElementById('openId');
      var value2 = input.value;
      if (!value2) {
        return;
      }
      fetch('/api/hllService/addToken', {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json'
        },
        body: JSON.stringify({
          token: value,
          openId: value2
        })
      }).then(function (res) {
        console.log(res);
      }).catch(function (err) {
        console.log(err);
      })
    });
  </script>
</body>
</html>